<?php

declare(strict_types=1);

namespace app\command;

use app\api\services\DtsService;
use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\facade\Cache;

/**
 * 排行榜结算
 */
class GameDtsCalc extends Command
{

    protected function configure()
    {
        //每周一零点出头，计算上周的排行

        $this->setName('game:dts:calc')
            ->setDescription('dts');
    }

    protected function execute(Input $input, Output $output)
    {
        $rankList = DtsService::calcLastWeekRank();
        $key = 'dtsgame:lastweekranklist';
        Cache::store("redis")->set($key, $rankList);
    }
}